package tp_imag.service.impl;

public class Coordenada {
	private int x;
	private int y;

	public Coordenada(Coordenada c) {
		x = c.x;
		y = c.y;
	}
	public Coordenada() {
		x = 0;
		y = 0;
	}

	
	public Coordenada(int valorX, int valorY) {
		x = valorX;
		y = valorY;
	}
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		return (this.x == ((Coordenada) obj).getX()) && (this.y == ((Coordenada) obj).getY());
	}
	
	public void mover(VectorDirector direccion){
		/*this.x += direccion.getX() * longitud; 
		this.y += direccion.getY() * longitud;
		*/
		this.x += direccion.getX() ; 
		this.y += direccion.getY() ;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "X: "+this.getX()+" Y: "+this.getY();
	}
	
}
